import request from '@/utils/request'
//新增。
export function add(data) {
    console.log(data);
    if (data.routeDefault == false) {
        data.routeDefault = 0
    } else {
        data.routeDefault = 1
    }
    return request({
        url: '/delivery/route',
        method: 'post',
        data
    })
}
//分页数据
export function getList(currentPage, count, deliveryDate) {
    return request({
        url: `/delivery/route/${currentPage}/${count}`,
        method: 'get',
        data: deliveryDate
    })
}
//删除
export function del(driver_id) {
    return request({
        url: `/delivery/route/${driver_id}`,
        method: 'delete',
    })
}
//修改
export function edit(data) {
    if (data.routeDefault == false) {
        data.routeDefault = 0
    } else {
        data.routeDefault = 1
    }
    return request({
        url: '/delivery/route',
        method: 'put',
        data
    })
}

